//
//  KYMiddleView.m
//  kuaiyi
//
//  Created by 杨亮 on 16/3/11.
//  Copyright © 2016年 kuaiyi. All rights reserved.
//

#import "KYMiddleView.h"
#import <Masonry.h>

@implementation KYMiddleView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor whiteColor];
        [self setUpUI];
    }
    return self;
}
-(void)setUpUI{
    UIImageView *imageView = [[UIImageView alloc]initWithImage:[UIImage  imageNamed:@"mingyitong"]];
    UILabel *label = [[UILabel alloc]init];
    label.text = @"名医通";
    [self addSubview:imageView];
    [self addSubview:label];
    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(12);
        make.width.equalTo(@6);
        make.height.equalTo(@20);
        make.centerY.equalTo(self.mas_centerY);
    }];
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(imageView.mas_right).offset(10);
        make.top.equalTo(self.mas_top).offset(15);
        make.bottom.equalTo(self.mas_bottom).offset(-15);
    }];
}
@end
